package org.example.graalvmdemo.controller;

import org.example.graalvmdemo.service.TestService;
import org.example.graalvmdemo.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    private final UserService userService;
    private final TestService testService;

    public UserController(UserService userService, TestService testService) {
        this.userService = userService;
        this.testService = testService;
    }

    @GetMapping("/users/{id}")
    public String getUser(@PathVariable Long id) {
        return userService.getUserById(id);
    }

    @GetMapping("/welcome")
    public String getWelcome() {
        return userService.getWelcomeMessage();
    }

    @GetMapping("/test/{id}")
    public String getTestUser(@PathVariable Long id) {
        return testService.getUserById(id);
    }

    @GetMapping("/test/welcome")
    public String getTestWelcome() {
        return testService.getWelcomeMessage();
    }



}